//
//  IconFonts.swift
//  
//
//  Created by tank on 2021/12/16.
//

import Foundation
import UIKit

public protocol IconFontsDataSource {
    var fontPath: String { get }
}

public class IconFonts {

    public static let shared = IconFonts()

    public static var dataSource: IconFontsDataSource?

    private init() {
        guard let path = IconFonts.dataSource?.fontPath else {
            return
        }

        _ = UIFont.ex.registerFont(forResource: path, bundle: Bundle.main)
    }

    func iconFont(size: CGFloat) -> UIFont {
        return UIFont(name: "iconfont", size: size) ?? UIFont.systemFont(ofSize: size)
    }

    public static let arrowLeft = "\u{e60b}"

    public static let arrowRight = "\u{e60d}"
}
